home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 0220 / chat.txt < prev    next >
Text File  |  1997-03-26  |  9KB  |  231 lines

  1. WinNET Mail and News (TM)
  2. Copyright (c) 1992 - 1995 by WinNET Communications, Inc.
  3. ALL RIGHTS RESERVED
  4.  
  5. Editing the chat script
  6.  
  7. If you are reading this while setting up WinNET  with
  8. the setup program, you will probably also want to refer
  9. to this file later when you edit your chat.rc file.
  10.  
  11.  
  12. What is the chat.rc file?
  13.  
  14. The chat.rc file controls the log-in process between the
  15. time that your modem connects to the remote site to the
  16. time when the uucico (unix-to-unix-copy-in-copy-out)
  17. protocol starts up.  (uucico is the basic mail/news
  18. transfer program that handles data transfer under uucp).
  19.  
  20. A default chat.rc file is put in the directory where you
  21. installed WinNET by the setup program.  The chat.rc that
  22. is created by default may not be adequate to actually
  23. log-in to your remote uucp site, so you'll have to
  24. modify it so that it is complete.
  25.  
  26. When your modem connects and established a link/protocol
  27. with the remote site, the remote site will start sending
  28. various log-in prompts that your WinNET uucico module
  29. needs to respond to successfully log-in.  In the
  30. simplest type of log-in sequence, the remote site will
  31. spawn some type of banner with information about itself
  32. (such as the brand name of it's operating system and some
  33. sort of welcome message), and then emit the prompt
  34.  
  35. login:
  36.  
  37. After receiving input for login, the remote will typically
  38. then emit
  39.  
  40. password:
  41.  
  42. After receiving input for password, it will verify the
  43. inputs and, if they are correct, start up its own uucico
  44. and then mail / news transfer takes place.  
  45.  
  46. So, the chat.rc script is to control the scripting just of
  47. this simple log-in phase.  However, in the 'real world',
  48. the log-in process can become more complicated.  Many
  49. uucp provider sites have several layers of logging in.  In
  50. most cases, you have to log-in in 2 steps; first, you have
  51. to log-in to a generic terminal server front end; after you
  52. get past the terminal server, you can then log-in pretty
  53. much as described above.  The precise sequence is
  54. something that your uucp provider should be able to provide.
  55.  
  56.             Before Configuring your chat.rc File...
  57.  
  58. It is almost always a good idea to fire up a terminal
  59. emulation program like Window's 'Terminal' or 'Procomm'
  60. to directly dial the telephone number of your uucp provider
  61. and try logging on to the remote system manually before
  62. trying to configure chat.rc.
  63.  
  64. This exercise gives you a very clear idea of the behavior of
  65. the remote system, and also allows you to verify that the
  66. login name(s) and password(s) that your provider has given
  67. you are actually correct.  
  68.  
  69. Doing this may well save you hours of exasperation trying
  70. to configure your chat.rc file, particularly if you don't
  71. have the correct login/password information to begin with! 
  72.  
  73. For uucp, you can tell that you've successfully logged-in
  74. when you see the output:
  75.  
  76.     Shere=remote_name
  77.     
  78. from the remote site, where 'remote_name' is the machine
  79. name of the remote system.  When you get this far, it
  80. means that you've logged in completely, and the remote site
  81. has permitted you access to uucico.  (You'll have to hang
  82. up your modem at this point though, unless you know how to
  83. manually enter the correct sequence to continue with
  84. uucico!) 
  85.  
  86. Now, lets look at how the chat.rc script works.
  87.  
  88. The chat.rc script is designed to be able to do what you
  89. could do manually if you called your uucp provider with a
  90. terminal emulation program (like procomm or terminal for
  91. Windows) and visually looked for the various prompts and
  92. then typed in the proper inputs. In each case, you 'expect'
  93. to see a prompt and then 'send' (type) the correct
  94. response. The chat.rc file allows you the script these
  95. expect/send pairs for up to 15 levels. 
  96.  
  97. For each prompt that is expected, you create an entry in
  98. the chat.rc file.  Each entry consists of 2 lines, and each
  99. entry is separated by a blank line.  Here is the syntax
  100. format of an entry in chat.rc, followed by a realistic
  101. example:
  102.  
  103. expect text
  104. send text
  105.  
  106. ; example entry
  107. login:
  108. $S\n
  109.  
  110. Let's break down each of the 2 lines in detail:
  111.  
  112. 1. expect text
  113.  
  114. This line shows the literal text of the prompt that is
  115. expected from the remote uucp site.  In most cases, this
  116. will be case sensitive.  Spaces are acceptable, but it is
  117. also fine just to use the last few characters of the
  118. prompt if you know that these characters will not be
  119. repeated in any of the other output from the remote.  Our
  120. example expect text could usually be abbreviated as
  121. 'ogin:', for example.
  122.  
  123. 2. send text
  124.  
  125. This line lists the text of what our system should
  126. send to the remote as input for the prompt listed in the
  127. expect text line.  The '$S' is a parameter in this example
  128. is replaced with your UUCP system name.  This keeps your system
  129. name from appearing in the chat script.
  130.  
  131. Often, other UUCP service providers use a different login
  132. name than the system name.  If your login name is different,
  133. you will need to edit the chat.rc file to put in the proper
  134. login name.
  135.  
  136. It is also *crucial* to remember that the send text line will
  137. almost always have to end with the correct line termination
  138. character for the system you are connecting to (the
  139. equivalent of hitting the ENTER or RETURN key of your
  140. keyboard).  For this purpose, there are several special
  141. characters that you can enter preceded by a backspace.  These
  142. characters are not literal representations of the characters
  143. that will be emitted to the remote site, but rather,
  144. placeholders or symbols that will be replaced when the
  145. program actually runs by the correct control characters. 
  146. Presently, the following special characters are
  147. implemented:
  148.  
  149.     \n      unix-style 'new line' character (ASCII 10)
  150.     \r      carriage return (ASCII 13)
  151.     \\      backslash
  152.     \b      space character (you can enter a space directly,
  153.             \b is just included to improve readability).
  154.     \,      pause one second
  155.     $S      insert system name
  156.     $P      insert password
  157.     $$      insert a single '$'
  158.  
  159. AS A RULE OF THUMB, IF YOU ARE CONNECTING TO A UNIX SYSTEM,
  160. MAKE SURE TO TERMINATE EACH LINE OF THE SEND TEXT LINE
  161. WITH A \n    IF THE SYSTEM YOU ARE CONNECTED TO IS *NOT* A
  162. UNIX SYSTEM, INSTEAD TERMINATE EACH LINE OF THE SEND TEXT
  163. LINE WITH A \r
  164.  
  165.  
  166. Initiating Output
  167.  
  168. In some cases, when your modem connects to the remote site,
  169. the remote site will not emit its prompts until it has
  170. received some cueing or prompting from your system.  In most
  171. cases where this is true, the remote will wait for one or
  172. more end of line characters from your system before emitting
  173. its first log-in prompt.  (If you called with a terminal
  174. emulator, you'd have to hit the RETURN/ENTER key a few times
  175. before seeing any output from the remote site).  This can
  176. be tricky, because the number of carriage returns and the
  177. interval of time between them can be unpredictable; it
  178. doesn't always work exactly the same way twice! 
  179. (Sometimes you have to hit ENTER twice, sometimes three or
  180. four times).
  181.  
  182. To initiate unprompted output the chat.rc file provides a
  183. special statement called the "INITIATE" statement.  The
  184. syntax is:
  185.  
  186. INITIATE
  187. send text
  188.  
  189. The send text line of the INITIATE statement can be
  190. whatever you like, but in most situations where you would
  191. want to use an INITIATE statement, it will be
  192. something like \,\n\,\n\,\n\,\n which indicates
  193. pause-newline-pause-newline-pause-newline,
  194. pause-newline, a sequence that will sufficiently 'cue'
  195. most terminal servers. 
  196.  
  197. Comments
  198.  
  199. You can put comments at the TOP of your chat.rc file.  Once
  200. the script proper begins, NO comments are allowed. 
  201. If you wish to put a comment(s) at the top of the
  202. script, put a semi-colon character in column one of
  203. each line that you intend as a comment.  It is also OK
  204. to use blank lines in the chat.rc (with or without
  205. comment semi-colons), up to the point where the script
  206. actually begins -- BUT, once the script begins, blank
  207. lines are syntactically significant, indicating the end
  208. of an entry, so make sure that your entries are
  209. separated by just 1 blank line once the script
  210. begins. 
  211.  
  212. A Complete Sample chat.rc
  213.  
  214. ; sample chat.rc
  215. ; the \,\r\, in the INITIATE statement indicates that
  216. ; the communications program should initiate the login
  217. ; process by pausing one second, issuing a carriage return
  218. ; character (ascii 13) and pausing again for one second.
  219.  
  220. INITIATE
  221. \,\r\,
  222.  
  223. ogin:
  224. $S\n
  225.  
  226. word:
  227. $P\n
  228.  
  229.  
  230.  
  231.